<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>个人信息</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
        $(function(){
            $('#inputForm').submit();
        });
		/*$(document).ready(function() {
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('<spring:message code="common.subbmiting"/>');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});*/
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
        <li class="active"><a href="javascript:void(0);"><spring:message code='user.add'/></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="user" action="${ctx}/sys/user/formsave" method="post" class="form-horizontal">
		<sys:message content="${message}"/>
        <div class="control-group">
            <label class="control-label"><spring:message code="common.account"/>:</label>
            <div class="controls">
                <label class="lbl">${user.loginName}</label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label"><spring:message code="common.name"/>:</label>
            <div class="controls">
                <label class="lbl">${user.name}</label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label"><spring:message code="common.authority"/>:</label>
            <div class="controls">
                <label class="lbl">${user.roleNames}</label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label"><spring:message code="common.expiration"/>:</label>
            <div class="controls">
                <fmt:formatDate value="${user.avaliDate}" pattern="yyyy-MM-dd"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label"><spring:message code="common.phone_number"/>:</label>
            <div class="controls">
                <label class="lbl">${user.mobile}</label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label"><spring:message code='common.remarks'/>:</label>
            <div class="controls">
                <label class="lbl">${user.remarks}</label>
            </div>
        </div>
        <div class="control-group">
			<label class="control-label"><spring:message code="common.company"/>:</label>
			<div class="controls">
				<label class="lbl">${user.company.name}</label>
			</div>
		</div>
		<c:if test="${user.userType == '3'  or user.userType == '4'}">
        <div class="control-group">
            <label class="control-label"><spring:message code="Senior.district.administrator"/>:</label>
            <div class="controls">
                <label class="lbl">${user.areaBy.name}</label>
            </div>
        </div>
        </c:if>
        <div class="control-group">
            <label class="control-label"><spring:message code="common.group"/>:</label>
            <div class="controls">
            	<c:if test="${user.userType != '2'}">
            	     <label class="lbl">${user.office.name}</label>          	
            	</c:if>
            </div>
        </div>
       <c:if test="${ user.userType == '4'}">
        <div class="control-group">
            <label class="control-label"><spring:message code="Superior.maintenance.personnel"/>:</label>
            <div class="controls">
                <label class="lbl">${user.maintainBy.name}</label>
            </div>
        </div>
           <div class="control-group">
               <label class="control-label"><spring:message code="Superior.maintenance.personnel"/> <spring:message code="common.phone_number"/>:</label>
            <div class="controls">
                <label class="lbl">${user.maintainBy.mobile}</label>
            </div>
        </div>
        </c:if>
		<div class="form-actions">
            <a onclick="window.history.back();" class="btn btn-success"><spring:message code='common.back'/></a>
            <input type="submit" class="btn "  id="autosubmit" value="<spring:message code='common.confirm'/>"/>
        </div>
	</form:form>
</body>
</html>